<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<button @click="update">修改</button>
			<ul>
				<li v-for="s in stus" :key="s.id">{{s.id}},{{s.name}},{{s.age}}</li>
			</ul>
		</div>
		<script type="text/javascript">
			let vm = new Vue({
				el: '#app',
				data: {
					stus: [{
							id: 1,
							name: '郭德纲',
							age: 20
						},
						{
							id: 2,
							name: '于谦',
							age: 30
						},
						{
							id: 3,
							name: '岳云鹏',
							age: 40
						}
					]
				},
				methods: {
					update() {
						// this.stus[1].name = '于谦谦'
						// this.stus[1] = {
						// 	id: 2,
						// 	name: '于谦谦',
						// 	age: 35
						// };
						// this.stus.push({id:4,name:'孙越',age:30})
						this.stus[3]={id:4,name:'孙越',age:30}
					}
				}

			})
		</script>
	</body>
</html>
